//
//  ModelBase.h
//  DataCenter
//
//  Created by Tang Haibo on 12-6-7.
//  Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>

#define KeyClassNameMuti @"__multi"     //可能多种类型

#define ATTRIBUTE_INFO(__key__, __className__, __keyClassName__) [NSDictionary dictionaryWithObjectsAndKeys:__key__, @"key",\
__className__, @"className",\
__keyClassName__, @"keyClassName",\
nil]

#define ATTRIBUTE_INFO_NUMBER(__key__) ATTRIBUTE_INFO(__key__, @"NSNull", @"NSNumber")


#define KEY_FROM_ATTRIBUTE_INFO(__info__) [__info__ objectForKey:@"key"]
#define CLASSNAME_FROM_ATTRIBUTE_INFO(__info__) [__info__ objectForKey:@"className"]
#define KEYCLASSNAME_FROM_ATTRIBUTE_INFO(__info__) [__info__ objectForKey:@"keyClassName"]


@interface QBModelBase : NSObject<NSCoding>
{
    
}

- (id)initWithDict:(NSDictionary *)dict;
- (BOOL)isParseSucceed;

//属性映射字典
//属性名：json数据key
- (NSDictionary *)attributedMapDictionary;
@end
